Skip to content

Conversation

@tk-o
Copy link
Contributor

@tk-o tk-o commented Feb 10, 2026

Lite PR

Tip: Review docs on the ENSNode PR process

Summary

Includes:

  1. Connecting with invalid URL.
  2. Connecting to unavailable host.
  3. Fetching invalid data from host.

Why

  • ENSAdmin has to handle various ENSNode connection errors very gracefully in the UI.

Testing

  • How this was tested.
  • If you didn't test it, say why.

Notes for Reviewer (Optional)

  • I'm applying as simple updates as I can to avoid sinking in ENSAdmin refactorings that would stop me from progressing other goals.

Pre-Review Checklist (Blocking)

  • This PR does not introduce significant changes and is low-risk to review quickly.
  • Relevant changesets are included (or are not required)

Includes 1) connecting with invalid URL; 2) connecting to unavailable host; 3) fetching invalid data from host.
Copilot AI review requested due to automatic review settings February 10, 2026 16:21
@changeset-bot
Copy link

changeset-bot bot commented Feb 10, 2026

⚠️ No Changeset found

Latest commit: 9493bf3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link
Contributor

vercel bot commented Feb 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
admin.ensnode.io Ready Ready Preview, Comment Feb 10, 2026 4:21pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
ensnode.io Skipped Skipped Feb 10, 2026 4:21pm
ensrainbow.io Skipped Skipped Feb 10, 2026 4:21pm

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refines ENSAdmin’s UI handling for ENSNode connection failures by centralizing the error display and ensuring the page header still renders when the selected connection is invalid.

Changes:

  • Introduces a shared ENSNodeConnectionError component for connection-related error UI.
  • Updates SelectedENSNodeProvider to always render a provided header, even when the selected connection URL is invalid.
  • Switches RequireActiveConnection to use the shared connection error UI on ENSNode config errors.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
apps/ensadmin/src/components/providers/selected-ensnode-provider.tsx Adds a header prop and renders it in both valid/invalid connection flows; uses shared connection error UI for invalid URL case.
apps/ensadmin/src/components/layout-wrapper.tsx Passes the existing header markup into SelectedENSNodeProvider via the new header prop.
apps/ensadmin/src/components/connections/require-active-connection.tsx Uses ENSNodeConnectionError instead of ErrorInfo when useENSNodeConfig() reports an error.
apps/ensadmin/src/components/connections/connection-error.tsx Adds ENSNodeConnectionError wrapper around ErrorInfo with standardized messaging.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +22 to +24
<ENSNodeConnectionError
error={new Error(`Unable to parse ENSNode Config: ${error?.message}`)}
/>
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ENSNodeConnectionError always renders the title "Unable to connect to ENSNode", but here the error being surfaced is "Unable to parse ENSNode Config". This makes the UI message inconsistent; either keep using ErrorInfo for config-parse failures or make ENSNodeConnectionError accept an overridable title/description.

Copilot uses AI. Check for mistakes.
Comment on lines 19 to +24
* @param children - React children to render within the provider context
*/
export function SelectedENSNodeProvider({ children }: PropsWithChildren) {
export function SelectedENSNodeProvider({
header,
children,
}: PropsWithChildren<{ header: React.ReactNode }>) {
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSDoc for SelectedENSNodeProvider only documents children, but the component now requires a header prop as well. Update the doc comment to describe the new prop and its purpose (rendered even when the selected connection is invalid).

Copilot uses AI. Check for mistakes.
Comment on lines 38 to 42
// between the selected connection being in a valid format or not.
// This logic will throw and an error and break if the selected connection
// is in an invalid format.

return (
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TODO comment says the invalid-format path "will throw and break", but this branch now handles invalid URLs by rendering an error component. Update or remove the comment to reflect the current behavior (and clarify what still needs refactoring, if anything).

Copilot uses AI. Check for mistakes.
Comment on lines +3 to +7
export function ENSNodeConnectionError({ error }: { error: Error }) {
return (
<ErrorInfo
title="Unable to connect to ENSNode"
description={`Please check your connection settings and try again. Error: ${error.message}`}
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ENSNodeConnectionError hard-codes the title and formats the full error message into the description, which makes it awkward to reuse for non-connection failures (e.g. config parse errors). Consider accepting optional title/description overrides (or an ErrorInfoProps passthrough) so callers can keep messaging accurate while still sharing the layout.

Suggested change
export function ENSNodeConnectionError({ error }: { error: Error }) {
return (
<ErrorInfo
title="Unable to connect to ENSNode"
description={`Please check your connection settings and try again. Error: ${error.message}`}
export function ENSNodeConnectionError({
error,
title,
description,
}: {
error: Error;
title?: string;
description?: string;
}) {
return (
<ErrorInfo
title={title ?? "Unable to connect to ENSNode"}
description={
description ??
`Please check your connection settings and try again. Error: ${error.message}`
}

Copilot uses AI. Check for mistakes.
import { useENSNodeConfig } from "@ensnode/ensnode-react";

import { ENSNodeConnectionError } from "@/components/connections/connection-error";
import { ErrorInfo } from "@/components/error-info";
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ErrorInfo is imported but no longer used after switching to ENSNodeConnectionError; remove the unused import to keep lint/typecheck clean.

Suggested change
import { ErrorInfo } from "@/components/error-info";

Copilot uses AI. Check for mistakes.
Comment on lines +22 to +24
<ENSNodeConnectionError
error={new Error(`Unable to parse ENSNode Config: ${error?.message}`)}
/>
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrapping error in new Error(...) drops the original error object (stack/cause). Consider either passing the original error through to ENSNodeConnectionError (and letting it format unknowns safely), or construct the new error with { cause: error } so debugging info is preserved.

Copilot uses AI. Check for mistakes.
<section className="p-6">
<ErrorInfo title="Unable to parse ENSNode Config" description={error.message} />
<ENSNodeConnectionError
error={new Error(`Unable to parse ENSNode Config: ${error?.message}`)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
error={new Error(`Unable to parse ENSNode Config: ${error?.message}`)}
error={new Error(`Unable to parse ENSNode Config: ${error.message}`)}

Using optional chaining on error field when it's guaranteed to be defined by React Query's type system after status check

Fix on Vercel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant